package com.aiYouPms.common.enumdata;

import lombok.Getter;

@Getter
public enum Status {
    ENABLED(1, "启用"),
    DISABLED(0, "禁用"),
    DELETED(-1, "删除");

    private final Integer code;
    private final String description;

    Status(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static Status fromCode(Integer code) {
        for (Status status : Status.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }
}

